home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Tools / Alpha 6.51b13 ƒ / Tcl / SystemCode / AlphaBits.tcl~ < prev    next >
Text File  |  1996-08-15  |  3KB  |  126 lines

  1. if {[file exists "$HOME:Tcl:SystemCode:calc.tcl"]} {
  2.     set alphaLite 0
  3. } else {
  4.     set alphaLite 1
  5. }
  6.  
  7. # if {[string match {*b[0-9]*} [version]] && ![file exists "Powerpete:C"]} {
  8. #     alertnote "This is a BETA version of Alpha. Do NOT redistribute!"
  9. # }
  10.  
  11.  
  12. #if {[regexp {[]\(\)\"\{\}\[]} $HOME]} {alertnote "Alpha may not work properly if it's pathname includes parenthesis, square brackets, double quotes, or curly braces."}
  13. # Get name Alpha's current name.
  14. foreach p [processes] {
  15.     if {[lindex $p 1] == "ALFA"} {
  16.         set ALPHA [lindex $p 0]
  17.         break
  18.     }
  19. }
  20.  
  21.  
  22. # Icon menu names. The number refers to the resource id of the #ics family.
  23. set winMenu         "•263"
  24.  
  25. set globalMenus_curr    {fsetMenuName icMenu mailMenu}
  26.  
  27.  
  28. # A few definitions I'll need later.
  29. proc quoteExpr str {
  30.     regsub -all {\\} $str {\\\\} str
  31.     regsub -all {\|} $str {\|} str
  32.     regsub -all {\*} $str {\\*} str
  33.     regsub -all {\+} $str {\\+} str
  34.     regsub -all {\(} $str {\\(} str
  35.     regsub -all {\)} $str {\\)} str
  36.     regsub -all {\[} $str {\\[} str
  37.     regsub -all {\]} $str {\\]} str
  38.     return $str
  39. }
  40.  
  41. proc quoteExpr2 str {
  42.     regsub -all {\$} $str {\\$} str
  43.     regsub -all {\^} $str {\\^} str
  44.     regsub -all {\\} $str {\\\\} str
  45.     regsub -all {\|} $str {\|} str
  46.     regsub -all {\*} $str {\\*} str
  47.     regsub -all {\+} $str {\\+} str
  48.     regsub -all {\(} $str {\\(} str
  49.     regsub -all {\)} $str {\\)} str
  50.     regsub -all {\{} $str "\\\{" str
  51.     regsub -all {\}} $str "\\\}" str
  52.     regsub -all {\[} $str {\\[} str
  53.     regsub -all {\]} $str {\\]} str
  54.     return $str
  55. }
  56.  
  57. #===============================================================================
  58.  
  59. set auto_path [list $HOME:Tcl:SystemCode $HOME:Tcl:UserCode $HOME:Tcl:Modes $HOME:Tcl:Menus]
  60.  
  61.  
  62. source "$HOME:Tcl:SystemCode:library.tcl"
  63.  
  64. source "$HOME:Tcl:SystemCode:menus.tcl"
  65. source "$HOME:Tcl:SystemCode:keyBindings.tcl"
  66. source "$HOME:Tcl:SystemCode:definitions.tcl"
  67. source "$HOME:Tcl:SystemCode:procs.tcl"
  68. source "$HOME:Tcl:SystemCode:flags.tcl"
  69. source "$HOME:Tcl:SystemCode:modes.tcl"
  70. source "$HOME:Tcl:SystemCode:copyRing.tcl"
  71.  
  72. # Bogus, but needs to be before userStartup read.
  73. set cwSig MMCC
  74. set cwdSig MWDB
  75.  
  76. set useEmacs 1
  77.  
  78. # Read both scalar and array definitions from preferences folder.
  79. if {!$skipPrefs} {
  80.     catch {readUserDefs}
  81. }
  82.  
  83. # After userprefs read.
  84. source "$HOME:Tcl:SystemCode:emacs.tcl"
  85.  
  86. # Set up color indices
  87. foreach ind [array names colorInds] {
  88.     eval setRGB $ind $colorInds($ind)
  89. }
  90.  
  91. foreach m $globalMenus_curr {
  92.     if {![catch $m]} {
  93.         insertMenu [set $m]
  94.     }
  95. }
  96.  
  97. updateSuffixes
  98. buildRecentFiles
  99.  
  100.  
  101. if {![info exists readReadme] || ($readReadme != [string trim [lindex [version] 2] {,}])} {
  102.     addDef readReadme [string trim [lindex [version] 2] {,}]
  103.     edit -r "$HOME:Help:Readme"
  104. } else {unset readReadme}
  105.  
  106.  
  107. if !$alphaLite {
  108.     source "$HOME:Tcl:SystemCode:paths.tcl"
  109.     source "$HOME:Tcl:SystemCode:smarterSource.tcl"
  110. }
  111.  
  112. setupPrintMenu
  113.  
  114. # "Switch To" submenu...
  115. buildSwitches
  116.  
  117. # Add to chars considered part of words.
  118. addAlphaChars {_ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÅØæøæß}
  119.  
  120.  
  121.  
  122. message "Initialization Complete"
  123.  
  124.  
  125.  
  126.